Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__fact(X)) → ACTIVATE(X)
ACTIVATE(n__fact(X)) → FACT(activate(X))
ADD(s(X), Y) → S(add(X, Y))
FACT(X) → IF(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
ACTIVATE(n__prod(X1, X2)) → PROD(activate(X1), activate(X2))
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__s(X)) → S(activate(X))
IF(true, X, Y) → ACTIVATE(X)
FACT(X) → ZERO(X)
PROD(s(X), Y) → PROD(X, Y)
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → P(activate(X))
PROD(s(X), Y) → ADD(Y, prod(X, Y))
ACTIVATE(n__0) → 01
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X1)
ADD(s(X), Y) → ADD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__fact(X)) → ACTIVATE(X)
ACTIVATE(n__fact(X)) → FACT(activate(X))
ADD(s(X), Y) → S(add(X, Y))
FACT(X) → IF(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
ACTIVATE(n__prod(X1, X2)) → PROD(activate(X1), activate(X2))
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__s(X)) → S(activate(X))
IF(true, X, Y) → ACTIVATE(X)
FACT(X) → ZERO(X)
PROD(s(X), Y) → PROD(X, Y)
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → P(activate(X))
PROD(s(X), Y) → ADD(Y, prod(X, Y))
ACTIVATE(n__0) → 01
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X1)
ADD(s(X), Y) → ADD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 3 SCCs with 7 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

ADD(s(X), Y) → ADD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

ADD(s(X), Y) → ADD(X, Y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PROD(s(X), Y) → PROD(X, Y)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

PROD(s(X), Y) → PROD(X, Y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__fact(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__fact(X)) → FACT(activate(X))
FACT(X) → IF(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X1)
IF(true, X, Y) → ACTIVATE(X)
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By instantiating [15] the rule IF(true, X, Y) → ACTIVATE(X) we obtained the following new rules:

IF(true, n__s(n__0), n__prod(y_2, n__fact(n__p(y_3)))) → ACTIVATE(n__s(n__0))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
QDP
                ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__fact(X)) → ACTIVATE(X)
IF(true, n__s(n__0), n__prod(y_2, n__fact(n__p(y_3)))) → ACTIVATE(n__s(n__0))
ACTIVATE(n__p(X)) → ACTIVATE(X)
ACTIVATE(n__fact(X)) → FACT(activate(X))
FACT(X) → IF(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X1)
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X2)
IF(false, X, Y) → ACTIVATE(Y)
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By instantiating [15] the rule IF(false, X, Y) → ACTIVATE(Y) we obtained the following new rules:

IF(false, n__s(n__0), n__prod(y_2, n__fact(n__p(y_3)))) → ACTIVATE(n__prod(y_2, n__fact(n__p(y_3))))



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ Instantiation
              ↳ QDP
                ↳ Instantiation
QDP

Q DP problem:
The TRS P consists of the following rules:

ACTIVATE(n__fact(X)) → ACTIVATE(X)
ACTIVATE(n__p(X)) → ACTIVATE(X)
IF(true, n__s(n__0), n__prod(y_2, n__fact(n__p(y_3)))) → ACTIVATE(n__s(n__0))
ACTIVATE(n__fact(X)) → FACT(activate(X))
FACT(X) → IF(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X2)
ACTIVATE(n__prod(X1, X2)) → ACTIVATE(X1)
IF(false, n__s(n__0), n__prod(y_2, n__fact(n__p(y_3)))) → ACTIVATE(n__prod(y_2, n__fact(n__p(y_3))))
ACTIVATE(n__s(X)) → ACTIVATE(X)

The TRS R consists of the following rules:

fact(X) → if(zero(X), n__s(n__0), n__prod(X, n__fact(n__p(X))))
add(0, X) → X
add(s(X), Y) → s(add(X, Y))
prod(0, X) → 0
prod(s(X), Y) → add(Y, prod(X, Y))
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
zero(0) → true
zero(s(X)) → false
p(s(X)) → X
s(X) → n__s(X)
0n__0
prod(X1, X2) → n__prod(X1, X2)
fact(X) → n__fact(X)
p(X) → n__p(X)
activate(n__s(X)) → s(activate(X))
activate(n__0) → 0
activate(n__prod(X1, X2)) → prod(activate(X1), activate(X2))
activate(n__fact(X)) → fact(activate(X))
activate(n__p(X)) → p(activate(X))
activate(X) → X

Q is empty.
We have to consider all minimal (P,Q,R)-chains.